﻿using System;
using System.Net;

namespace Bricks.Security
{

    /// <summary>
    /// 
    /// </summary>
    /// <typeparam name="TFilter"></typeparam>
    public abstract class IPAddressFilterFacadeBase<TFilter> : FacadeBase<TFilter>, IIPAddressFilterFacade<TFilter>
    {

        /// <summary>
        /// 
        /// </summary>
        /// <param name="filterAccessor"></param>
        protected IPAddressFilterFacadeBase(Func<TFilter> filterAccessor) :
            base(filterAccessor)
        {
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="address"></param>
        /// <returns></returns>
        public abstract bool Grant(IPAddress address);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="address"></param>
        /// <param name="key"></param>
        /// <returns></returns>
        public abstract bool Grant(IPAddress address, string key);
    }
}
